// <copyright file="UsingExistingGrid.aspx.cs" company="YUIAsp.Net">
// Copyright (c) 2009 All Right Reserved
// </copyright>
// <author>raul popescu</author>
// <email>dev@yuiasp.net</email>
// <date>2009-01-30</date>
// <summary>YUIAsp.Net File</summary>

using System;

namespace YUIAspNetDemo.DataTable
{
    public partial class UsingExistingGrid : BaseDemoPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            System.Data.DataTable tbl = new System.Data.DataTable();
            tbl.Columns.Add("col_1");
            tbl.Columns.Add("col_2");
            tbl.Columns.Add("col_3");

            tbl.Rows.Add("val 11", "val 12", "val 13");
            tbl.Rows.Add("val 21", "val 22", "val 23");
            tbl.Rows.Add("val 31", "val 32", "val 33");
            tbl.Rows.Add("val 41", "val 42", "val 43");
            tbl.Rows.Add("val 51", "val 52", "val 53");

            this.grid.DataSource = tbl;
            this.grid.DataBind();

            dt.DraggableColumns = true;
            dt.Columns.Add(new YUIAspNet.DataTableColumn { Key = "col_1", Resizeable=true, Sortable=true });
            dt.Columns.Add(new YUIAspNet.DataTableColumn { Key = "col_2", Resizeable = true, Sortable = true });
            dt.Columns.Add(new YUIAspNet.DataTableColumn { Key = "col_3", Resizeable = true, Sortable = true });
        }
    }
}
